<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zn-ch">
<head>
<title>Chenko-Login</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="apple-mobile-web-app-title" content="Chenko" />
<link rel="shortcut icon" type="image/x-icon" href="../static/images/flame.ico" media="screen" />
<link rel="stylesheet" href="${ctxS}/amazeUI/css/amazeui.min.css" />
<link rel="stylesheet" type="text/css" href="${ctxS}/common/chenko.css">
<script type="text/javascript" src="${ctxS}/jquery/jquery-3.1.1.min.js"></script>
<script src="${ctxS}/amazeUI/js/amazeui.min.js"></script>
<script src="${ctxS}/amazeUI//js/app.js"></script>
<script type="text/javascript" src="${ctxS}/common/common.js"></script>
</head>
<body class="theme-black">
	<!-- <a href="#" id="start" class="btn btn-primary">定时任务开始</a>
    <a href="#" id="remove" class="btn btn-primary">定时任务移除</a>
    <a href="#" id="robot" class="btn btn-primary">聊天机器人</a> -->
	<div class="am-g tpl-g">
		<div class="tpl-login">
			<div class="tpl-login-content">
				<div class="tpl-login-logo"></div>
				<c:if test="${message != null }">
					<div class="am-alert am-alert-${message.type }" data-am-alert>${message.message }</div>
				</c:if>
				<form class="am-form tpl-form-line-form" id="loginForm" action="${ctx}/sys/login/access" method="post">
					<div class="am-form-group">
						<input type="text" class="tpl-form-input" id="loginName" name="loginName" placeholder="请输入账号"
							value="${userDto.loginName }">
					</div>
					<div class="am-form-group">
						<input type="password" class="tpl-form-input" id="loginPassword" name="loginPassword" placeholder="请输入密码">
					</div>
					<div class="am-form-group tpl-login-remember-me">
						<input id="remember" name="remember" type="checkbox">
						<label for="remember"> 十天内免登录 </label>
					</div>
					<div class="am-form-group">
						<button type="submit" class="am-btn am-btn-primary am-btn-block tpl-btn-bg-color-success tpl-login-btn">提交</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	function submitForm(obj) {
		var $form = $(obj).closest('form');
		var loginName = $('#loginName').val();
		var loginPassword = $('#loginPassword').val();
		$form.attr('action', '${ctx}/sys/login/access/' + loginName + '/'
				+ loginPassword);
		$form.submit();
	}

	$("#start").on("click", function(e) {
		$.post("${ctx}/task/start", {
			name : "1",
			cron : "0/5 * * * * ?"
		});
	})

	$("#remove").on("click", function(e) {
		$.post("${ctx}/task/remove", {
			name : "1"
		});
	})
	$("#robot").on("click", function(e) {
		$.post("http://www.tuling123.com/openapi/api", {
			key : "6adc52db49eb4e41aea26f0d86507dde",
			info : "你叫什么名字？"
		}, function(msg) {
			alert(msg.text);
		});
	})
</script>
</html>